﻿@using EUTmvc.Helpers
@model IEnumerable<EUTmvc.Models.Admin.AdminExamIndexAction>

<div class="panel panel-default">
    <div class="panel-heading">
        <strong>Danh sách đề thi</strong>
    </div>
    <div class="panel-body">
        <div class="table-responsive">
            <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                <thead>
                    <tr>
                        <th>STT</th>
                        <th>@Html.DisplayNameFor(model => model.Id)</th>
                        <th>@Html.DisplayNameFor(model => model.Subtest)</th>
                        <th>@Html.DisplayNameFor(model => model.Description)</th>
                        <th>@Html.DisplayNameFor(model => model.CreateBy)</th>
                        <th>@Html.DisplayNameFor(model => model.CreateDate)</th>
                        <th>
                            <a href="@Url.Action("New", "AdminExamAction")" data-modal="" class="btn btn-primary pull-right"><span class='glyphicon glyphicon-plus'></span></a>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @{int i = 0;}
                    @foreach (var item in Model)
                    {
                        i++;
                        <tr>
                            <td>
                                @i
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Id)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Subtest)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Description)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.CreateBy)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.CreateDate)
                            </td>
                            <td>
                                <div class="pull-right">
                                    <a href="@Url.Action("Edit", "AdminSubtestAction", new { Id = item.Id })" data-modal="" class="btn btn-default"><span class='glyphicon glyphicon-pencil'></span></a>&nbsp;
                            <a href="@Url.Action("Delete", "AdminSubtestAction", new { Id = item.Id })" data-modal="" class="btn btn-danger"><span class='glyphicon glyphicon-trash'></span></a>&nbsp;
                                </div>
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
@Scripts.Render("~/bundles/modalform")
<script src="@Url.Content("/Scripts/plugins/dataTables/jquery.dataTables.js")"></script>
<script src="@Url.Content("/Scripts/plugins/dataTables/dataTables.bootstrap.js")"></script>
<script>
    $(document).ready(function () {
        $('#dataTables-example').dataTable();
    });
</script>

